﻿using Axios.Engine;
using FarseerPhysics.Dynamics;
using FarseerPhysics.Factories;
using FarseerPhysics.SamplesFramework;
using Microsoft.Xna.Framework;

namespace axios_tennis
{
    class Wall : SimpleAxiosGameObject
    {
        public Wall(Vector2 position, string name)
        {
            this.Position = position;
            this.Name = name;
        }

        public override void LoadContent(AxiosGameScreen gameScreen)
        {
            base.LoadContent(gameScreen);

            this.BodyPart = BodyFactory.CreateRectangle(gameScreen.World, .5f, ConvertUnits.ToSimUnits(gameScreen.ScreenManager.GraphicsDevice.Viewport.Height), 1f);
            this.BodyPart.Position = Position;
            this.BodyPart.BodyType = BodyType.Static;
            this.BodyPart.Friction = 0f;
            this.BodyPart.UserData = this;

            this.BodyPart.FixedRotation = true;
        }
    }
}